package com.czy.fx.fxml;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;

import java.io.InputStream;
import java.net.URL;

public class Demo1 extends Application {

    public static void main(String[] args) {
        launch(args);
    }
    @Override
    public void start(Stage primaryStage) throws Exception {
        InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream("myFxml.fxml");
        FXMLLoader fxmlLoader = new FXMLLoader();
        AnchorPane load = fxmlLoader.load(resourceAsStream);
        URL url = this.getClass().getClassLoader().getResource("css/cs.css");
        load.getStylesheets().add(url.toExternalForm());
        Scene scene = new Scene(load);
        primaryStage.setScene(scene);
        primaryStage.setMaximized(true);
        System.out.println(primaryStage.getMaxWidth());
        System.out.println(primaryStage.getMaxHeight());
        primaryStage.show();

    }
}
